Programmable controllers have developed into computer systems that are high in function and high in performance, because of the programmability and flexibility thereof. Generally, the sequence of control operations performed by a programmable controller may be visualized as the electro mechanical equivalent of switch operations, contact closings and coil energization, However, the processing of the programmable controller may also include various functions such as differentiation, integration, inversion and the like, and address index qualification of a memory or the like, which may be executed by a microprocessor, without being limited to mere contacts and coil analogues. Further, controlling such as analog controlling, positioning processing or the like is also executed. Analog control, positioning control or the like is mainly executed by a special function unit, and sequence control is mainly executed by a CPU unit.
Monitoring of the sequence program in the CPU unit will hereunder be described. Initially, it should be noted that term "sequence scan", as used below, generally indicates that the sequence program is repeatedly executed from the beginning (0 step) to the end (END). Furthermore, the end of the sequence scan generally indicates such a period of time that, after execution of the end (END) of the sequence program, the beginning (0 step) of the sequence program is subsequently executed.
FIG. 16 of the attached drawings illustrates a system arrangement of a conventional programmable controller. As shown in FIG. 16, a CPU unit 1 controls a programmable controller as a whole. A sequence program is stored in a program memory 1a. A device memory 1b is used in the sequence program; also data resulting from performed computations are stored in the device memory 1b. Information related to a monitoring function is stored in a work memory 1d. A program apparatus 2 compiles the sequence program and converts it to a form which is stored in the program memory 1a; it also monitors execution of the sequence program. The CPU unit 1 is connected to the program apparatus 2 through a communication cable 3. The reference numeral 4 denotes an input-output unit, and/or special function unit. The reference numeral 2a denotes a display in the program apparatus 2 for monitoring.
FIG. 17 shows an example of the sequence program. K5 and K8 indicate numerical data 5 and 8, respectively. Moreover, Z0 and Z1 execute a qualification of device numbers of a device such as an input X0, an output Y10 and the like. (a) identifies step numbers of the sequence program, (b) identifies data transfer commands, that is, commands for storing numerical data "5" and "8" into the index registers Z0 and Z1 allocated to the device memory 1b, (c) is a command for computing input information, and (d) is a command for computing output information. Further, operation of the commands (c) and (d) is such that, when X5 (X0Z0=X(0+Z0)=X(0+5)=X5) is turned "ON", Y18(Y10Z1=Y(10+Z1)=Y(10+8)=Y18) is turned "ON".
FIG. 18 illustrates an example of monitoring the sequence programs (c) and (d).
FIGS. 19(a), 19(b) and 19(c) show monitoring function information stored in the work memory 1d of the CPU unit 1, which is transmitted from the CPU unit 1 to the program apparatus 2 through the communication cable 3. Specifically, FIG. 19(a) identifies the categories of relevant monitoring function information in the conventional art. FIG. 19(b) is an example of monitoring function information for the input-information computation command (c) illustrated in FIG. 18. Finally FIG. 19(c) is an example of monitoring function information for the output-information computation command (d).
A specific operation, for example, monitoring of the sequence program, will next be described which consists of an input computation command (contact of relay) and an output computation command (coil of relay) in which an output of the index registers Z0 and Z1 are added to the input device X0 and the output device Y10.
Furthermore, in this example, a case will be described where the device X0 is turned "ON". In this case, the device and number without index qualification are stored from the monitoring function information shown in FIGS. 19(a), 19(b) and 19(c) with respect to the input-information computation command X0Z0(c). That is, with "X0" being the contents of the device, the CPU unit 1 simply stores "ON" as a result of the input computation X0, into the work memory 1d at each of the ends of the sequence scans. Subsequently, the program apparatus 2 interrupts the CPU unit 1 through the communication cable 3 every predetermined or constant cycle, to output a transmission demand of the monitoring function information. The CPU unit 1 transmits the monitoring function information "X0" and "ON" stored in the work memory 1d, to the program apparatus 2 through the communication cable 3, at the end of the sequence scan which receives this demand. After the program apparatus 2 has received the monitoring function information, the program apparatus 2 displays the contents of the monitoring function information on the display 2a, as shown in FIG. 18.
Similarly with respect to the output-information computation command Y10Z1(d), where the device and number are not index-qualified, that is, "Y10" being the contents of the device, the CPU unit 1 stores "ON" as a result of the output computation Y10, into the work memory 1c at each of the ends of the sequence scan. In the program according to this example, if "X0" is "ON", then "Y10" is "ON". Subsequently, the program apparatus 2 interrupts the CPU unit 1 through the communication cable 3 every constant cycle, to output a demand for transmission of the monitoring function information. The CPU unit 1 transmits the monitoring function information "Y10" and "ON" stored in the work memory 1d, to the program apparatus 2 through the communication cable 3, at the end of the sequence scan which receives this demand. After the program apparatus 2 has received the monitoring function information, the program apparatus 2 displays the contents of the monitoring function information on the display 2a as shown in FIG. 18.
FIGS. 20 through 26 are flow charts which schematically describe the above-described operation.
As shown in FIG. 20, the CPU unit 1 executes initial processing (S1) after a power source has been turned on. Subsequently, the sequence program (S2) and END processing (S3) are executed repeatedly. On the side of peripheral equipment, initial processing (S4) is executed after the power source has been turned on. Subsequently, while awaiting key inputting (S5), processings such as monitor processing (S6), screen switching processing (S7) and the like are executed. At this time, an operator opens a screen for monitoring. When monitoring is executed, the peripheral equipment interrupts the CPU unit 1, transmits information to be monitored, and the peripheral equipment is on stand by.
FIG. 21 is the flow chart showing schematic operation of interrupt processing on the side of the CPU unit 1. After a kind of the interruption has been judged (S8), the CPU unit 1 receives a transmission which demands the monitoring function data (S9), for example.
FIG. 22 is the flow chart showing the operation regarding execution of the sequence program on the side of the CPU unit 1 illustrated in FIG. 20. First, the kind of conventional command (e.g., MOV, LD, OUT, etc.) is selected (S10). Then, the selected MOV command processing (S11) which means that the contents of the memory in the CPU unit 1 are transmitted to another memory location, LD command processing (S12) which means that an ON/OFF information of the relay are stored in the memory, OUT command processing (S13) which means that an ON/OFF operation is executed in accordance with the information stored in the memory and the like are executed, and the program proceeds to END command.
FIG. 23 is the flow chart regarding a transmission demand of the monitor data on the side of the CPU unit 1 illustrated in FIG. 21. After a monitor demand flag has been set to presence (S14), a device number to be monitored is saved in the work memory 1c (S15).
FIG. 24 is the flow chart showing operation of END processing on the side of the CPU unit 1 illustrated in FIG. 20. After the main END processing (S3) has been executed (S16), the monitor processing is executed (S17).
Further, FIG. 25 is the flow chart showing the details of the monitor processing illustrated in FIG. 24. First, it is judged that if a flag of the monitor demand is present (S18). In the case where it is judged that the flag of the monitor demand is present, the monitor demand flag is set to absent (S19) and, subsequently, devices to be monitored are read out of the work memory 1c, to save data corresponding respectively to the devices, into the work memory 1c (S20). Subsequently, data to be monitored, are transmitted within the work memory 1c (S21).
FIG. 26 is the flow chart regarding monitor processing on the side of the peripheral equipment illustrated in FIG. 20. First, data indicating the devices and the number to be monitored are saved in the work memory 1c under a condition that the devices and number are not index-qualified (S22). Subsequently, the devices and number to be monitored are transmitted to the side of the CPU unit 1 from the work memory 1c (S23). Subsequently, the condition of receiving waiting (S24) is established. In the case where it is judged that data is being received, monitor data is saved to the work memory 1c (S25). Thus, the monitor data is displayed on the screen from the work memory 1c (S26).
The conventional programmable controller has been constructed as described above. Thus, the monitor contents of the programs (c) and (d) merely display a condition which is not index-qualified, that is, display only the "ON" condition or "OFF" condition of X0 and Y10. No index information is displayed.
Accordingly, in the case where the required devices having index qualification are monitored, not only the screen illustrated in FIG. 18, but also the value of the index qualification, that is, "5" and "8" in this example, must be confirmed. Subsequently, for the index-qualified devices, the display screens of X5 and Y18, must be called up by the operator. For this reason, it is impossible to monitor the devices which have been index-qualified on the same screen on which the program is monitored. Thus, efficient operability is remarkably reduced.